<form class="form-inline definewidth m20" action="<?php echo $url; ?>" method="get">
    <?php if($type != 'advert' && $type != 'operat'){ ?>
    <div class="control-group">
        <div class="controls">
            <label class="control-label" for="inputId">编号：&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</label>
            <input type="text" name="id" id="id" class="abc input-default" placeholder="编号" value="<?php echo $_GET['id']?>">&nbsp;&nbsp;
            <label class="control-label" for="inputKeyword">关键字：</label>
            <input type="text" name="keyword" id="keyword" class="abc input-default" placeholder="关键字" value="<?php echo $_GET['keyword']?>">&nbsp;&nbsp;
            <?php if($type != 'busi'){ ?>
                <label class="control-label" for="inputBusi">商户名称：</label>
                <select name="b_id">
                    <?php if(!$_GET['b_id'] || $_GET['b_id'] == ""){?>
                        <option value="" selected>全部</option>
                    <?php 
                        }else{ ?>
                            <option value="" >全部</option>  
                    <?php 
                        } 
                        foreach($busi_info as $row ){
                            $option =  "<option value='".$row['b_id']."'";
                            if($_GET['b_id'] == $row['b_id']) $option .= " selected";
                            $option .= ">".$row['b_name']."</option>";  
                            echo $option;
                        }
                    ?>
                </select>
            <?php } ?>
        </div>
    </div>
    <div class="control-group">
        <div class="controls">
            <label class="control-label" for="inputUser">上传用户：</label>
            <select name="user_id"  placeholder="用户名">
            <?php if(!$_GET['user_id'] || $_GET['user_id'] == ""){?>
                <option value="" selected>全部</option>
            <?php 
                }else{ ?>
                 <option value="" >全部</option>
            <?php 
                } 
                foreach($users as $row ){
                    $option =  "<option value='".$row['user_id']."'";
                        if($_GET['user_id'] == $row['user_id']) $option .= " selected";
                        $option .= ">".$row['user_name']."</option>";  
                        echo $option;
                }
            ?>
            </select>&nbsp;&nbsp;

            <label class="control-lable">选择审核状态：</label>
            <select name="state"  placeholder="选择审核状态">
            <?php if(!$_GET['state'] || $_GET['state'] == ""){?>
                <option value="" selected>全部</option>
            <?php 
                }else{ ?>
                 <option value="" >全部</option>
            <?php } ?>
                <option value="0" <?php if($_GET['state'] == '0'){?>selected<?php } ?> >待审核</option>
                <option value="1" <?php if($_GET['state'] == '1'){?>selected<?php } ?>>审核通过</option>
                <option value="2" <?php if($_GET['state'] == '2'){?>selected<?php } ?> >审核不通过</option>
            </select>&nbsp;&nbsp;
        </div>
    </div>
    <button type="submit" class="btn btn-primary">查询</button>&nbsp;&nbsp;
    <button type="button" id = "add" class="btn btn-primary">添加</button>&nbsp;&nbsp;
    <?php } ?>
    <?php if($type == 'advert'){ ?>
        <div class="control-group">
            <div class="controls">
                <label class="control-lable">投放位置：</label>
                <select name="adv_location"  placeholder="投放位置">
                    <?php if(!$_GET['adv_location'] || $_GET['adv_location'] == ""){?>
                        <option value="" selected>全部</option>
                    <?php
                    }else{ ?>
                        <option value="" >全部</option>
                    <?php } ?>
                    <?php foreach($adv_location as $k=>$v ) { ?>
                        <option <?php if($_GET['adv_location'] == $k) echo 'selected';?> value="<?php echo $k;?>"><?php echo $v;?></option>
                    <?php } ?>
                </select>&nbsp;&nbsp;
            </div>
        </div>
        <button type="submit" class="btn btn-primary">查询</button>&nbsp;&nbsp;
        <button type="button" id = "addAdvert" class="btn btn-primary">添加</button>&nbsp;&nbsp;
    <?php } ?>
    <?php if($type == 'operat'){ ?>
        <div class="control-group">
            <div class="controls">
                <label class="control-lable">操作类型：</label>
                <select name="type"  placeholder="操作类型">
                    <?php if(!$_GET['type'] || $_GET['type'] == ""){?>
                        <option value="" selected>全部</option>
                    <?php
                    }else{ ?>
                        <option value="" >全部</option>
                    <?php } ?>
                    <option value="1" <?php if($_GET['type'] == '1'){?>selected<?php } ?> >推荐</option>
                    <option value="2" <?php if($_GET['type'] == '2'){?>selected<?php } ?>>置顶</option>
                    <option value="3" <?php if($_GET['type'] == '3'){?>selected<?php } ?> >冻结</option>
                </select>&nbsp;&nbsp;
            </div>
        </div>
        <button type="submit" class="btn btn-primary">查询</button>&nbsp;&nbsp;
        <button type="button" id = "add" class="btn btn-primary">添加</button>&nbsp;&nbsp;
    <?php } ?>
</form>